package com.demo.cotroller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by wangzhanjin on 2018/6/8.
 */
@Controller
@RequestMapping("/web")
public class HomeController {


    @RequestMapping(value = "error")
    public String error(ModelMap map) {
        throw new RuntimeException();
    }

    @RequestMapping("index")
    public String index(Model model) {
        model.addAttribute("title", "帅帅的title");
        return "index";
    }
}
